fix: resolve 4 cross-package bugs causing 9 test failures#13
Open
stooit wants to merge 1 commit into
Open
Conversation
- Fix renamed hook import: useThrottle → useDebounce in apps/web/src/lib/api.ts, re-exported as useSearchDebounce to match consumer expectations - Add aria-label to icon-only Button variant for accessibility - Fix stale closure in DataTable sort handler using functional state update - Fix date format string to use d/MM/yyyy (no zero-padded day) - Configure bun test DOM environment via happy-dom preload script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 9 failing tests across this TypeScript monorepo by resolving 4 cross-package bugs:
packages/utils→apps/web):useThrottlewas renamed touseDebouncein utils but the old name was still imported inapps/web/src/lib/api.ts. Fixed the import and added auseSearchDebouncere-export to match what consumers expect.packages/ui): The icon-onlyButtonvariant was missing anaria-labelprop, causing an a11y test to fail.packages/ui): TheDataTablesort handler captured a stalesortDirectionvalue. Fixed by using a functional state update (prev => ...).packages/utils):formatDateuseddd/MM/yyyy(zero-padded day) but tests expectd/MM/yyyy(no leading zero on day).happy-domso React component tests have a DOM available.Verification
Assumptions
bun:testTypeScript module resolution errors are expected (bun provides this at runtime) and not considered failures.happy-domwas already installed innode_modules— no new dependencies added.